package org.blogwu.learn.algorithm.树.二叉搜索树;

import org.blogwu.learn.algorithm.树.二叉搜索树.printer.BinaryTrees;

public class RemoveTest {
    public static void main(String[] args) {
        Integer[] ints = new Integer[]{
//                11, 24, 7, 4, 25, 21, 6, 20, 30
//                80, 68, 91, 87, 75, 16, 33, 81, 83, 25, 97, 67, 45, 24, 65, 100, 61,69,70,77,78,76
//                5,3,6,2,4,7
//                0
//                3,1,4,2
//                5,3,6,2,4,7
//                10,25,16,32,30,14,17,15
                10, 25, 16, 32, 30, 14, 19, 15, 17
        };
        BinarySearchTree<Integer> tree = new BinarySearchTree<>();
        for (int i = 0; i < ints.length; i++) {
            tree.add(ints[i]);
        }

        BinaryTrees.print(tree);
        System.out.println("");
        System.out.println("-----------");
        tree.removeOld(tree.getRoot(), 16);
        BinaryTrees.print(tree);
//        tree.inorderTraversal();

    }

}
